#pragma once
#include <string>
#include <deque>

using namespace std;
namespace U31
{

	class Palindrome
	{

	private:
		deque<char> queue, stack;
	public:

		Palindrome()
		{
		}

		~Palindrome()
		{
		}

		bool palindrome(string s)
		{
			for (auto t : s)
			{
				queue.push_back(t);
				stack.push_back(t);
			}
			for (int i = 0; i < queue.size(); i++)
			{
				if (queue.front() == stack.back())
				{
					queue.pop_front();
					stack.pop_back();
				}
				else
					return false;
			}
			return true;
		}

		bool palindromeRecursive(string s)
		{
			if (s.length() < 2)
				return false;
			if (s[0] == s[s.length() - 1])
			{
				palindromeRecursive(s.substr(1, s.length() - 2));
			}
			else
			{
				return false;
			}
			return true;
		}
	};
}

